#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N,k;
struct cho{
	int h,w;
};
cho a[100005];
// bool cmp(cho c1,cho c2){
//   return c1.h*c1.w < c2.h * c2.w;
// }  
bool check(int x){
	int cnt = 0;
	
	for(int i = 0;i < N ; i ++){
		cnt += (a[i].h / x) * (a[i].w / x);
	}
	if(cnt >= k) return 1;
	else return 0;
}
int main()
{
	// 请在此输入您的代码
	cin >>N>> k;
	// vector<cho> a(k);
	for(int i= 0; i < N; i++){
		cin >> a[i].h >> a[i].w;
	}
	// sort(a,a+N,cmp);
	
	
	int ll = 1, rr = 100001;
	int res = 0;
	while(ll <= rr){
		int mid = ll +(rr -ll) /2;
		int cc = 0;
		for(int i = 0 ; i <  n ; i ++)
		{
			int cw = a[i].w / mid;
			int ch = a[i].h / mid;
			cc += cw *ch;
		}
		if(cc >= k ){
			res = mid;
			ll = mid +1;
		}else rr = mid -1;
	}
	cout << res <<endl;
	return 0;
}
